<?php

/**
 * @copyright 2011
 * @version $Id$
 * @access public
 * @author oriotiori

 */

class Admin_Model_Configs extends Zend_Db_Table_Abstract{

    protected $_name = 'configs';

/**
 * @return array $data
 */
    public function getConfigs()
    {
        $TO = new Admin_Model_TO_Configs();
        
        $data=array();
        try{
            $sql=$this->getAdapter()
            		->select()
            		->from(TABLE_PREFIX.$this->_name);


            $res = $this->getAdapter()->fetchAll($sql);
            $rowCount=count($res);
			
            if($rowCount>0){
                foreach($res as $dt){
                    $TO->setId_Estado($dt['Id_Estado']);
                    $TO->setId_Pais($dt['Id_Pais']);
                    $TO->setProduct_Mini_Thumb_Width($dt['Product_Mini_Thumb_Width']);
                    $TO->setProduct_Mini_Thumb_Height($dt['Product_Mini_Thumb_Height']);
                    $TO->setProduct_Thumb_Width($dt['Product_Thumb_Width']);
                    $TO->setProduct_Thumb_Height($dt['Product_Thumb_Height']);
                    $TO->setProduct_Medium_Width($dt['Product_Medium_Width']);
                    $TO->setProduct_Medium_Height($dt['Product_Medium_Height']);
                    $TO->setCategory_Thumb_Width($dt['Category_Thumb_Width']);
                    $TO->setCategory_Thumb_Height($dt['Category_Thumb_Height']);
                    $TO->setManufacturer_Thumb_Width($dt['Manufacturer_Thumb_Width']);
                    $TO->setManufacturer_Thumb_Height($dt['Manufacturer_Thumb_Height']);
                    $TO->setLimit_New_Products($dt['Limit_New_Products']);
                    $TO->setLimit_Related_Products($dt['Limit_Related_Products']);
                    $TO->setLimit_Featured_Products($dt['Limit_Featured_Products']);
                    
                    
                }
                $data = $TO->getAllVars();
                return $data;
            }
        }catch(Exception $e)
        {
            $error=array($e->getFile(), 'Exception: '.$e->getMessage());
            $ExceptionHandler= new Default_Model_ExceptionHandler();
            $ExceptionHandler->saveErrors($error);
        }
        return false;
    }
    
}
